import DetailView from "@/views/DetailView.vue";
import HomeView from "@/views/HomeView.vue";
import NotFoundView from "@/views/NotFoundView.vue";
import TasksView from "@/views/TasksView.vue";
import { createRouter, createWebHistory } from "vue-router";

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: "/",
      component: HomeView,
      children: [
        { path: "", name: "tasks", component: TasksView },
        {
          path: "detail/:id",
          name: "detail",
          component: DetailView,
          props: true,
        },
        { path: ":pathMatch(.*)*", name: "notFound", component: NotFoundView },
      ],
    },
  ],
});

export default router;
